#define _CRT_SECURE_NO_WARNINGS
#include "2.3_hs.h"
int if_ss(int n)
{
	if (n % 2 == 0)
		if (n == 2)
			return 1;
		else
			return 0;
	else if (n % 2 != 0)
	{
		for (int i = 3; i < n; i += 2)
			if (n % i == 0)
				return 0;
	}
	return 1;
}

int rt_ss(int n)
{
	static int i = 3;
	if (n == 2)
		i = 3;
	for (i; 1; i += 2)
	{
		int flag = 1;
		for (int j = 3; j < i; j += 2)
		{
			if (i % j == 0)
			{
				flag = 0;
				break;
			}
		}
		if (flag == 1 || i == 3)
		{
			i += 2;
			return i - 2;
		}
	}
}

void fjzys()
{
	int n, i = 2;
	scanf("%d", &n);
	printf("%d=", n);
	while (1)
	{
		if (if_ss(n))
		{
			printf("%d\n", n);
			break;
		}
		while (n % i == 0)
		{
			printf("%d*", i);
			if (if_ss(n))
			{
				printf("%d\n", n);
				goto jump;
			}
			n /= i;
		}
		i = rt_ss(i);
	}
	jump:
	system("pause");
	system("cls");
}